obj-m := cdata.o

KDIR := /lib/modules/$(shell uname -r)/build
PWD :=$(shell pwd)

default:
	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
	rm -r *.ko *.o *.mod.c *.mod.o *.symvers *.c~  Makefile~ *.o.cmd *.ko.cmd 
install:
	cp cdata.ko /lib/modules/`uname -r`/kernel/drivers/
	depmod -a
	insmod cdata.ko
	mknod /dev/cdata c 121 0
	chmod 777 /dev/cdata

uninstall:
	rm /dev/cdata
	rmmod cdata.ko
